Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sql): log the size of executions when they complete #4660

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

dbyron-sf
Copy link
Contributor

to make changes in size over time more observable. This makes it easier to see the impact of features like the artifact store.

Not setting the size in RedisExecutionRepository because the extra objectMapper.writeValueAsString is potentially expensive and I'm not sure how many folks are using redis for this.

@dbyron-sf
Copy link
Contributor Author

@Mergifyio update

Copy link
Contributor

mergify bot commented Feb 27, 2024

update

✅ Branch has been successfully updated

@jasonmcintosh
Copy link
Member

I'd wonder if this would be better as a metric vs. part of artifact storage? Not saying "no" as it'd be interesting to track it here...

@dbyron-sf
Copy link
Contributor Author

I'd wonder if this would be better as a metric vs. part of artifact storage? Not saying "no" as it'd be interesting to track it here...

With execution id as one of the tags I think cardinality would be too high. Probably config id too. But I could totally see taking those out and making this a metric.

@jasonmcintosh
Copy link
Member

Yeah :) I LIKE high cardinatlity metric data (YAY Honeycomb!) but... I KINDA lean towards removing them & keeping the data as a metric - would have LOVED pipeline size as a metric LONG ago to show exactly how bad this could be AND before/after artifact store support kinda stuff. Not AGAINST it in the DB but I could see this being a VERY compelling metric to track.

@jasonmcintosh
Copy link
Member

Application of course as a label, pipeline name as a label too ideally though that's iffy as that's getting high cardinality route. BUT makes it a LOT easier to track activity by "bad pipeline behavior" AND find pipelines that are heavy hitters.

@@ -64,6 +65,15 @@ class CompleteExecutionHandler(
message.determineFinalStatus(execution) { status ->
execution.updateStatus(status)
repository.updateStatus(execution)
val executionContextSize = execution.getTotalSize()
if (executionContextSize.isPresent) {
log.info("completed pipeline execution size: {},{},{},{},{}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something we've learned after living with this for awhile...this isn't necessarily the size of a pipeline execution once spinnaker is totally done with it. As in, things happen to pipeline executions after this. There's logic below to cancel stages of pipelines that didn't succeed, though we've also seen some succeeded pipelines change after this. We're still looking into it.

This log message still seems useful if not as an absolute number, at least as a way to measure change. As in, before/after of the artifact store, or other code changes that influence the size of the execution context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd absolutely go for the log message!

@dbyron-sf
Copy link
Contributor Author

Maybe this is obvious, but the size of execution contexts can change a ton during execution. Like, the completed size could be a small fraction of the max size. Reducing the max size can be a big win even if the completed size stays the same. Measuring this in some more thorough way is, from what I can tell, a non-trivial exercise.

@jasonmcintosh
Copy link
Member

ORIGINAL thought was some metrics on the storage interfaces to track what was written to the storage layer... but haven't dug AS much on this

@dbyron-sf
Copy link
Contributor Author

@jasonmcintosh is this OK to merge? Not sure @xibz has time to give it a look.

@dbyron-sf
Copy link
Contributor Author

@Mergifyio update

Copy link
Contributor

mergify bot commented Apr 15, 2024

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/release.yml without workflows permission

to make changes in size over time more observable.  This makes it easier to see the impact
of features like the artifact store.

Not setting the size in RedisExecutionRepository because the extra
objectMapper.writeValueAsString is potentially expensive and I'm not sure how many folks
are using redis for this.
@dbyron-sf
Copy link
Contributor Author

@Mergifyio update

Copy link
Contributor

mergify bot commented Apr 16, 2024

update

✅ Branch has been successfully updated

@jasonmcintosh jasonmcintosh added the ready to merge Approved and ready for merge label Apr 16, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Apr 16, 2024
@mergify mergify bot merged commit fff90a4 into spinnaker:master Apr 16, 2024
5 checks passed
@dbyron-sf dbyron-sf deleted the log-execution-size branch April 16, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.34
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants